﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="NewsDiary.ascx.cs" Inherits="VIT.Web.Modules.NewsDiary.NewsDiary" %>
<%--<div class="fr">
                        <div class="title">
                            Nhật ký SaiGon Wedding</div>
                        <div class="ct">--%>
<div class=" sgwedding">
    <div class=" sgwd-top">
    </div>
    <div class=" sgwd-center">
        <asp:Repeater runat="server" ID="rpt">
            <HeaderTemplate>
                <div class="sgwdleft">
                    <script type="text/javascript">
                        $(document).ready(function () {
                            var currentPosition = 0;
                            var slideWidth = 405;
                            var slides = $('.slide');
                            var numberOfSlides = slides.length;

                            // Remove scrollbar in JS
                            $('#slidesContainer').css('overflow', 'hidden');

                            // Wrap all .slides with #slideInner div
                            slides
    .wrapAll('<div id="slideInner"></div>')
                            // Float left to display horizontally, readjust .slides width
	.css({
	    'float': 'left',
	    'width': slideWidth
	});

                            // Set #slideInner width equal to total width of all slides
                            $('#slideInner').css('width', slideWidth * numberOfSlides);

                            // Insert controls in the DOM
                            $('#slideshow')
    .prepend('<span class="control" id="leftControl">Clicking moves left</span>')
    .append('<span class="control" id="rightControl">Clicking moves right</span>');

                            // Hide left arrow control on first load
                            manageControls(currentPosition);

                            // Create event listeners for .controls clicks
                            $('.control')
    .bind('click', function () {
        // Determine new position
        currentPosition = ($(this).attr('id') == 'rightControl') ? currentPosition + 1 : currentPosition - 1;

        // Hide / show controls
        manageControls(currentPosition);
        $('#slideInner').animate({
            'marginLeft': slideWidth * (-currentPosition)
        });
    });
                            function manageControls(position) {
                                if (position == 0) { $('#leftControl').hide() } else { $('#leftControl').show() }
                                if (position == numberOfSlides - 1) { $('#rightControl').hide() } else { $('#rightControl').show() }
                            }
                        });
                    </script>
                    <div id="slideshow">
                        <div id="slidesContainer">
            </HeaderTemplate>
            <ItemTemplate>
                <div class="slide">
                <a href="<%#linkComponent("Article","NewsPicDetail","sId="+Eval("Id"))%>" title="<%#Eval("Title") %>">
                    <img src="<%=URLRoot %>Uploads/Images/Articles/Thumbs/<%#Eval("Image") %>" width="383" height="250" alt="<%#Eval("Title") %>"></a>
                    <li>
                        <h2>
                            <a href="<%#linkComponent("Article","NewsPicDetail","sId="+Eval("Id"))%>" title="<%#Eval("Title") %>"><%#Eval("Title") %></a></h2>
                        <br />
                        <%#Eval("Brief").ToString().Replace("<p>","").Replace("</p>","")%>
                        <ul>
                            <a href="<%#linkComponent("Article","NewsPicDetail","sId="+Eval("Id"))%>" title="<%#Eval("Title") %>">Xem chi tiết</a>
                        </ul>
                    </li>
                </div>
            </ItemTemplate>
            <FooterTemplate>
                </div> </div> </div>
            </FooterTemplate>
        </asp:Repeater>
        <asp:Repeater runat="server" ID="rpt2">
            <HeaderTemplate>
                <div class="sgwdright">
                    <ul>
            </HeaderTemplate>
            <ItemTemplate>
                <li> <a href="<%#linkComponent("Article","NewsDetail","sId="+Eval("Id"))%>" title="<%#Eval("Title") %>">Ngày <%#Eval("DisplayDate","{0: dd/MM/yyyy}")%><br />
                    <%#Eval("Title") %></a>
                    <h3><%#Eval("Brief").ToString().Substring(3,Eval("Brief").ToString().Length-7)%></h3>
                </li>
            </ItemTemplate>
            <FooterTemplate>
                <h2><a href="<%=linkComponent("Article","List")%>">Xem tất cả</a></h2>
                </ul> </div>
            </FooterTemplate>
        </asp:Repeater>
    </div>
    <div class=" sgwd-bottom">
    </div>
</div>
<%--</div></div>--%>
